<?php
include 'connection.php';
function createListCategory() {

	$listCategory = callSP("getListCategory();");
	while ($rowCategory = mysql_fetch_array($listCategory)) {
		// Create category
		echo "<li> <a href=\"#\" categoryID = \"" . $rowCategory['CategoryID'] . "\">" . $rowCategory['CategoryName'] . "</a>  ";
		echo "<ul style=\"display: none;\" >";
		createListSubCategory($rowCategory['CategoryID']);
		echo "</ul>";
		echo " </li>";
	}
}

function createListSubCategory($argCategoryID) {
	$listSubCategory = callSP("getListSubCategory(" . $argCategoryID . ");");
	while ($rowSubCategory = mysql_fetch_array($listSubCategory)) {
		echo "<li> <a href=\"#\" subCategoryID = \"" . $rowSubCategory['SubCategoryID'] . "\">" . $rowSubCategory['SubCategoryName'] . "</a>  ";
		echo "</li>";
	}
}

function getUserID($argEmail, $argPassword) {
	$userID = callSP("getUserID('" . $argEmail . "','" . $argPassword . "');");
	if ($userID) {
		return $userID["UserID"];
	} else {
		return 0;
	}
}

function getListProvince(){
	$listProvince = callSP("getListProvince();");
	while ($rowProvince = mysql_fetch_array($listProvince)) {
		echo "<option value = \"" . $rowProvince['ProvinceID'] . "\">" . $rowProvince['ProvinceName'] . "</option>";
	}
}

function getListProfessionArea(){
	$listProfessionArea = callSP("getListProfessionArea();");
	while ($rowProfessionArea = mysql_fetch_array($listProfessionArea)) {
		echo "<option value = \"" . $rowProfessionArea['ProfessionAreaID'] . "\">" . $rowProfessionArea['ProfessionAreaName'] . "</option>";
	}
}
?>